﻿using System.Collections.Generic;
using System.Linq;
using StockFinder.Model;
using StockFinder.StockLists.SymbolListEnumerators;

namespace StockFinder.StockLists.Exchanges
{
    public class NasdaqOnlineAllYahooFinanceOnlinePricesStockList : YahooFinanceOnlinePriceLoaderSymbolListEnumerator
    {
        protected override List<Symbol> GetSymbols()
        {
            /* just use the children to get symbols only, this object 
             * will be responsible for getting prices */

            var amex = new NasdaqOnlineAllAmexYahooFinanceOnlinePricesStockList { LoadPrices = false };
            var nasdaq = new NasdaqOnlineAllNasdaqYahooFinanceOnlinePricesStockList { LoadPrices = false };
            var nyse = new NasdaqOnlineAllNyseYahooFinanceOnlinePricesStockList { LoadPrices = false };

            var symbols = amex.ToList();
            symbols.AddRange(nyse);

            symbols.AddRange(nasdaq);

            return symbols;
        }
    }
}
